entry: Allocate icons at full height
authorTimm Bäder <mail@baedert.org>
Mon, 26 Feb 2018 11:29:11 +0000 (12:29 +0100)
committerTimm Bäder <mail@baedert.org>
Mon, 26 Feb 2018 11:53:49 +0000 (12:53 +0100)
Makes for a larger hit area for pointing devices. If vertical centering
is still desired, GtkWidget:halign can be set on the icon widgets.

gtk/gtkentry.c

index f9431937617b3eabd9f4121fdcbc155c053cc5e7..a032b9db87c0213840950b71a953ea68b3d4bece 100644 (file)
@@ -3182,7 +3182,7 @@ gtk_entry_size_allocate (GtkWidget           *widget,
     {
       EntryIconInfo *icon_info = priv->icons[i];
       GtkAllocation icon_alloc;
-      gint width, height;
+      int width;
 
       if (!icon_info)
         continue;
@@ -3192,11 +3192,6 @@ gtk_entry_size_allocate (GtkWidget           *widget,
                           -1,
                           NULL, &width,
                           NULL, NULL);
-      gtk_widget_measure (icon_info->widget,
-                          GTK_ORIENTATION_VERTICAL,
-                          -1,
-                          NULL, &height,
-                          NULL, NULL);
 
       if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL && i == GTK_ENTRY_ICON_PRIMARY) ||
           (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR && i == GTK_ENTRY_ICON_SECONDARY))
@@ -3208,9 +3203,9 @@ gtk_entry_size_allocate (GtkWidget           *widget,
           icon_alloc.x = allocation->x + priv->text_x;
           priv->text_x += width;
         }
-      icon_alloc.y = allocation->y + (allocation->height - height) / 2;
+      icon_alloc.y = 0;
       icon_alloc.width = width;
-      icon_alloc.height = height;
+      icon_alloc.height = allocation->height;
       priv->text_width -= width;
 
       gtk_widget_size_allocate (icon_info->widget, &icon_alloc, baseline, &child_clip);